import { GraphQLInt } from 'graphql';

let count = 0;

export default {
  // 定义返回的数据类型
  type: GraphQLInt,
  description: '修改例子',
  // 定义传参的数据结构
  args: {
    num: {
      type: GraphQLInt,
      description: '数量'
    }
  },
  resolve: (root: any, params: any) => {
    let { num } = params;
    count += num;
    return count;
  }
};
